//
//  MJTabBarController.m
//  NewClothesForEveryDay
//
//  Created by dllo on 15/7/13.
//  Copyright (c) 2015年 蓝天. All rights reserved.
//

#import "MJTabBarController.h"
#import "MailViewController.h"
#import "MJ_MainViewController.h"
#import "GX_MainViewController.h"
#import "DD_OneViewController.h"
#import "User_MainViewController.h"
#import "MJTabBar.h"
#import "MJTabBarButton.h"

@interface MJTabBarController ()<MJTabBarDelegate>



@end

@implementation MJTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    MailViewController *MainVc = [[[MailViewController alloc] init] autorelease];
    MJ_MainViewController *MJVc = [[[MJ_MainViewController alloc] init] autorelease];
    GX_MainViewController *GXVc = [[[GX_MainViewController alloc] init] autorelease];
    DD_OneViewController *DDVc = [[[DD_OneViewController alloc] init] autorelease];
    User_MainViewController *UserVc = [[[User_MainViewController alloc] init] autorelease];
    
    UINavigationController *MainNav = [[[UINavigationController alloc] initWithRootViewController:MainVc] autorelease];
    UINavigationController *MJNav = [[[UINavigationController alloc] initWithRootViewController:MJVc] autorelease];
    UINavigationController *GXNav = [[[UINavigationController alloc] initWithRootViewController:GXVc] autorelease];
    UINavigationController *DDNav = [[[UINavigationController alloc] initWithRootViewController:DDVc] autorelease];
    UINavigationController *UserNav = [[[UINavigationController alloc] initWithRootViewController:UserVc] autorelease];
    
    self.viewControllers = @[MainNav, MJNav, GXNav, DDNav, UserNav];
    
    
    
    MainVc.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"首页" image:[[UIImage imageNamed:@"8"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"7"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]] autorelease];
    
    
    MJVc.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"蓝天" image:[[UIImage imageNamed:@"8"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"7"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]] autorelease];
    
  
    GXVc.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"旭旭" image:[[UIImage imageNamed:@"8"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"7"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]] autorelease];
    
    
    DDVc.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"对对" image:[[UIImage imageNamed:@"8"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"7"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]] autorelease];
    
    
    UserVc.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"我的" image:[[UIImage imageNamed:@"8"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"7"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]] autorelease];
    
    
    
//    // 移除系统自带的tabBar
////        [self.tabBar removeFromSuperview];
//    // 1. 添加自己的TabBar
//    self.myTabBar = [[MJTabBar alloc] init];
//    self.myTabBar.delegate = self;
//    self.myTabBar.frame = self.tabBar.frame;
////    [self.view addSubview:self.myTabBar];
//    // 2. 添加对应个数按钮
//    for (int i = 0; i < self.viewControllers.count; i++) {
//        NSString *name = [NSString stringWithFormat:@"h%d.jpeg", i + 1];
//        NSString *selName = [NSString stringWithFormat:@"%d.jpg", i + 1];
//        [self.myTabBar addTabBarButtonWithName:name selName:selName];
//    }
    
    
    
}
///**
// *  自定义界面转换协议方法
// */
//- (void)tabBar:(MJTabBar *)tabBar didSelectItemFrom:(NSInteger)from to:(NSInteger)to
//{
//    self.selectedIndex = to;
//}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
